home *** CD-ROM | disk | FTP | other *** search
- Path: news.compuserve.com!newsmaster
- From: Mike Davies <100717.2065@compuserve.com>
- Newsgroups: comp.lang.c++
- Subject: Borland Turbo C++
- Date: Mon, 29 Jan 1996 23:40:43 -0800
- Organization: CompuServe Incorporated
- Message-ID: <310DCB7B.586@compuserve.com>
- NNTP-Posting-Host: hd34-135.compuserve.com
- Mime-Version: 1.0
- Content-Type: multipart/mixed; boundary="------------1FE43FA141F3"
- X-Mailer: Mozilla 2.0b6a (Win16; I)
-
- This is a multi-part message in MIME format.
-
- --------------1FE43FA141F3
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
-
- Help!!!
-
- I am using Borland Turbo C++ 3.1 under Windows 3.1 and am having serious
- trouble getting the attached program to run with the desired output.
-
- It compiles without error and runs to end, BUT the output to screen is
- all in BLACK not RED as is the purpose of the progam.
-
- If anyone knows what the problem may be - please let me know as this has
- been driving me mad for a number of weeks.
-
-
- Thanks.
-
- Mike
-
- EMAIL: 100717.2065@compuserve.com
- or Mike_Davies@compuserve.com
-
- --------------1FE43FA141F3
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- Content-Disposition: inline; filename="TEXTCOL.C"
-
-
- #include <stdio.h>
- #include <stdlib.h>
- #include <windows.h>
-
- /*****************************************************************************/
-
- void main(void)
- {
- HDC hdcIC;
- COLORREF colref;
-
- if((hdcIC = GetDC(NULL))==NULL)
- {
- strerror(errno);
- exit(1);
- }
-
- colref = GetTextColor(hdcIC);
- printf("\n\ncolref = %d (black)", colref);
-
- SetTextColor(hdcIC, RGB(255, 0, 0)); /* sets color to red */
-
- colref = GetTextColor(hdcIC);
- printf("\n\ncolref = %d (red)", colref);
-
- ReleaseDC(NULL, hdcIC);
-
- exit(0);
- }
-
- /*****************************************************************************/
- --------------1FE43FA141F3--
-
-